package com.homework.test03;

import java.util.Scanner;

/**
 * @author south wind
 * @version 1.0
 * @date 2025/4/7 19:48
 * @description 主体层实现类
 */
public class StuFunction {
    public static final Scanner INPUT = new Scanner(System.in);
    public static final StuDao stuDao = new StudentImpl();
    public static void main(String[] args) {
        while (true){
            System.out.println("======================");
            System.out.println("请输入要操作的功能：");
            System.out.println("1.添加学生信息");
            System.out.println("2.删除学生信息");
            System.out.println("3.修改学生信息");
            System.out.println("======================");
            int choice = INPUT.nextInt();
            INPUT.nextLine();

            switch (choice) {
                case 1:
                    stuDao.insertStu();
                    break;
                case 2:
                    stuDao.deleteStu();
                    break;
                case 3:
                    stuDao.updateStu();
                    break;
                default:
                    System.out.println("输入选择错误！");
                    return;
            }
        }
    }

}
